﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using RTGS.Library.Entities.Rtgs;
using RTGS.Library.DataAccess.Rtgs;
using System.Configuration;
using System.Data;

namespace RTGS.Web.form
{

public partial class form_StpRecordDetailO_Form : BasePage
{
        private string id = string.Empty;

        private stpRecordDetailORepo roleDal = new stpRecordDetailORepo(ConfigurationManager.ConnectionStrings["Rtgs"].ConnectionString);

        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.Params["Id"] != null)
            {
                id = HttpUtility.HtmlEncode(Convert.ToString(Request.Params["Id"]));
            }

            if (!Page.IsPostBack)
            {

                
                if (id.Trim().Length > 0) // Edit an existing item
                {
                    stpRecordDetailO obj = roleDal.GetById(id);
                    if (obj != null)
                    {
                        hfID.Value = id.ToString();

                        //GROUP TRN
                        txtTrn.Text = obj.recordDetailOtrTrn;
                        txtRelatedTrn.Text = obj.recordDetailOtrRelatedtrn;

                        //GROUP AMOUNT
                        txtAmount.Text = Convert.ToDecimal(obj.recordDetailOtrAmount).ToString("#,###.00");
                        txtCurrency.Text = obj.recordDetailOstCurrency.Trim();
                        txtBussinesDay.Text = obj.recordDetailOtrValuedate.Trim();

                       

                        //GROUP DEBIT PARTICIPANT
                        txtDebitParticipant.Text = obj.recordDetailOstFromaccountnumber.Trim();
                        txtAccountDebitParticipant.Text = obj.recordDetailOstFromaccountname.Trim();

                        //GROUP CREDIT PARTICIPANT
                        txtCreditParticipant.Text = obj.recordDetailOstToaccountnumber.Trim();
                        txtAccountCreditParticipant.Text = obj.recordDetailOstToaccountname.Trim();

                        //GROUP DEBIT PARTICIPANTS CLIENT
                        txtDebitParticipantsClient.Text = obj.recordDetailOstOriginatingname.Trim();
                        txtAccountDebitParticipantsClient.Text = obj.recordDetailOstOriginatingnumber.Trim();

                        //GROUP CREDIT PARTICIPANTS CLIENT
                        txtCreditParticipantsClient.Text = obj.recordDetailOstUltimatebenefname.Trim();
                        txtAccountParticipantsClient.Text = obj.recordDetailOstUltimatebenefaccount.Trim();

                        //GROUP DETAIL
                        txtRemitanceInformation.Text = obj.recordDetailOstMemberinfo.Trim();
                        txtDetailOfCharges.Text = obj.recordDetailOtrRecordtype.Trim();
                        txtTransactionSubTypeCode.Text = obj.recordDetailOtrTransactioncode.Trim();
                        txtSender.Text = obj.recordDetailOstPaymentdetails.Trim();
                        
                    }
                }
            }

        }

       
}
}